﻿using MediatR;
using RBAC.LuFang.API.Application.Command.MenuCommand;
using RBAC.LuFang.Domain;
using RBAC.LuFang.Domin.Services;

namespace RBAC.LuFang.API.Application.CommandHandlers.MenuHandler
{
    //显示父级菜单
    public class MenuPidSelectCommandHandler:IRequestHandler<MenuPidSelectCommand,List<MenuInfo>>
    {
        private readonly IMenuService _menuService;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="menuService"></param>
        public MenuPidSelectCommandHandler(IMenuService menuService)
        {
            _menuService = menuService;
        }

        public async Task<List<MenuInfo>> Handle(MenuPidSelectCommand request, CancellationToken cancellationToken)
        {
            return await _menuService.GetMenuPid();
        }
    }
}
